package com.qlzb.taskmanagement.pojo;

/**
 * Created with IntelliJ IDEA.
 *
 * @ClassName ReturnCode
 * @Description 返回结果的返回码和返回信息，
 *              结合返回数据封装类OutcomeWrapper,统一数据返回格式。
 * @Authr 袁聪
 * @Date 2018/6/1 16:20
 * @Version v2.0
 */
public enum  ReturnCode {
    FEAILED("0002","查询失败"),
    ACCOUNT_ERROR("1000", "账户不存在或被禁用"),
    API_NOT_EXISTS("1001", "请求的接口不存在"),
    API_NOT_PER("1002", "没有该接口的访问权限"),
    SIGN_ERROR("1005", "数据签名错误"),
    AMOUNT_NOT_QUERY("1010", "余额不够，无法进行查询"),
    API_DISABLE("1011", "查询权限已被限制"),
    UNKNOWN_IP("1099", "非法IP请求"),


    SUCCESS("2000","查询成功"),
    NODATA("2000-1", "查询成功无记录"),


    PARAMS_RIGHT("2002", "参数正常"),


    // -------------- 增删改查 start ------------------

    ADD_SUCCESS("2001","添加数据成功"),
    ADD_ERROR("5001","添加数据失败"),

    FIND_SUCCESS("2002","查询数据成功"),
    FIND_SUCCESS_NO_DATA("2002-1","查询数据成功，但没有数据"),
    FIND_ERROR("5002","查询数据失败"),

    EDIT_SUCCESS("2003","修改数据成功"),
    EDIT_ERROR("5003","修改数据失败"),

    DELETE_SUCCESS("2004","数据删除成功"),
    DELETE_ERROR("5004","数据删除失败"),



    // -------------- 增删改查 end ------------------




    // -------------- 登录 start ------------------

    NOT_LOGIN("6000","未登录"),
    LOGIN_SUCCESS("6001","登录成功"),
    LOGIN_ERROR("6002","登录失败"),
    LOGIN_FAILURE("6003","登录失效，请重新登录"),


    // -------------- 登录 end ------------------


    PARAMS_ERROR("4001", "参数为空或格式错误"),

    SERVER_ERROR("5000", "系统异常"),
    CRUD_ERROR("5005", "插入/修改/删除/查找数据失败"),





    SYSTEM_ERROR("9999", "系统异常");


    private String code;

    private String message;

    ReturnCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


}
